package com.health.ts.service.patientview;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.health.ts.dao.patientview.StPatientBaseinfoMapper;
import com.health.ts.entity.patientview.StPatientBaseinfo;

/**
 * <p>
 * 患者病历基本信息表 服务实现类
 * </p>
 *
 * @author ts
 * @since 2017-09-15
 */
@Service
public class StPatientBaseinfoService extends ServiceImpl<StPatientBaseinfoMapper, StPatientBaseinfo> {
	
	/**
	 * 获取患者基本信息
	 * @param patientId
	 * @return
	 */
	public StPatientBaseinfo getPatientBaseInfo(String patientId){
		StPatientBaseinfo result = null;
		QueryWrapper<StPatientBaseinfo> wrapper = new QueryWrapper<StPatientBaseinfo>();
		wrapper.eq("patient_id", patientId);
		List<StPatientBaseinfo> list = this.list(wrapper);
		if(!list.isEmpty()){
			result = list.get(0);
		}
		return result;
	}
}
